/*
 * All global variables
 */
 
var globalVar = {
    selectElement: false,
    menu: false,
    canvas: false,
    projectId: false,
    dbView: false,
    ontoView:false,
    dbs: [],
    ontos: [],
    mappingTables: [],
    gdTable: false,
    gdColumn: false,
    gdOnto: false,
    gdProperty: false
};

var statistic = {
    table: 0,
    column:0,
    ontology: 0,
    property: 0,
    mappingTable: 0,
    mappingOntology: 0,
    mappingColumn: 0,
    mappingProperty: 0
};

var style = {
    menuHeight: 25,
    highlightColor: "#00d0ff"
};

var namespace = {
    rdfSchema: "http://www.w3.org/2000/01/rdf-schema",
    catalogs: {}
};

var httpCred = {
    username:"demo",
    password:"demo",
    isDav:true
};

var sqlData = [ "integer", "binary", "char", "varchar", "datetime", "float", "real", "int", "bit", "text" ];

var prefixMap = [];

var saveOption = {
    storage:"DefaultQuadStorage",
    graph:"demo",
    uri:"http://^{URIQADefaultHost}^/demo_mapper",
    defaultDavPath:"/DAV/home/demo/",
    mappingPath: "/DAV/home/demo/mapping",
    rdfsPath:"/DAV/home/demo/onto",
    rdfDataPath:"/DAV/home/demo/RDFData",
    defaultOntoPrefix:"http://ccnt.zju.edu.cn/demo/#",
    defaultPropPrefix:"http://ccnt.zju.edu.cn/demo/#",
    defaultIRIPrefix:"http://ccnt.zju.edu.cn/demo/#",
    constIRIStringPrefix:"http://^{URIQADefaultHost}^/demo/"
};

var helper = {
    isparql:"/isparql",
    rdfbrowser:"/rdfbrowser/"
};

/**
 * default url rewriting rules
 */
var urlRewriteRules = [
    {
        ruleIRI:"linked_data_mapper_rule1",
        allowUpdate:"1",
        niceMatch:'(/[^#]*)',
        niceParams:"vector('path')",
        niceMinParams:"1",
        targetCompose:'/sparql?query=CONSTRUCT+{+%%3Chttp%%3A//^{URIQADefaultHost}^%U%%23this%%3E+%%3Fp+%%3Fo+}+FR+OM+%%3Chttp%%3A//^{URIQADefaultHost}^/Northwind%%3E+WHERE+{+%%3Chttp%%3A//^{URIQADefaultHost+}^%U%%23this%%3E+%%3Fp+%%3Fo+}&format=%U',
        targetParams:"vector('path', 'path', '*accept*')",
        targetExpn:"null",
        acceptPattern:'(text/rdf.n3)|(application/rdf.xml)',
        doNotContinue:"0",
        httpRedirectCodes:"null"
    },
    {
        ruleIRI:"linked_data_mapper_rule2",
        allowUpdate:"1",
        niceMatch:'(/[^#]*)',
        niceParams:"vector('path')",
        niceMinParams:"1",
        targetCompose:'/rdfbrowser/index.html?uri=http%%3A//^{URIQADefaultHost}^%U%%23this',
        targetParams:"vector('path')",
        targetExpn:"null",
        acceptPattern:'(text/html)|(\\\\*/\\\\*)',
        doNotContinue:"0",
        httpRedirectCodes:"303"
    }
];

var interval = {
    total: 0,
    loop: 1500
}
